(function($) {
	$(function() {
	
	    //获取cookie
		var 
			oImga=getCookie('jpz'),
			oName=getCookie('title00'),
			oPrice = getCookie('price0'),
			oValue=getCookie('value00');
			
		if(getCookie('price0')){
			
			$(".webz").css("display","block");
			$(".webz1").css("display","none");
			
			$(".img00").attr("src",oImga);
			$(".tit00").html(oName);
			$(".c_price_num").html(oPrice);
			$(".value0").val(oValue);
		}
		
		if(getCookie('value00')){
			$(".car-num").html(getCookie('value00'));
		}
		
		//购物车加载进来读取cookie
			var 
			lessBtn=$('.disabled'),
			addBtn=$('.abled'),
			oNum=$('.valu'),
			value=1;
			oNum.val(getCookie("value00"));
			value=oNum.val();
			var
				reg=/\d+/g;
				
			var a=reg.exec(getCookie("price0"))[0];
			//console.log(typeof a);
			$(".c_sum p i").html(parseInt(getCookie("value00"))*a);
			$(".c_piece i").html(getCookie("value00"));
			$(".fs_15").html(parseInt(getCookie("value00"))*a);
			$(".c_paid i").html(parseInt(getCookie("value00"))*a-10);
			var xValue = value*2098;
			
			lessBtn.click(function(){
				
			if(value==1){
				value=1;
				lessBtn.addClass("disabled");	
			}else{
				value--;
			}
			
			
			oNum.val(value);
			$(".c_sum p i").html(value*2098);
			$(".c_piece i").html(value);
			$(".fs_15").html(value*2098);
			$(".c_paid i").html(value*2098-10);
			
			setCookies('valu',$(".valu").val(),10);
			/*setCookies('title00',pro_Name.html(),10)
				
			setCookies('price0',pro_Price.html(),10)
			setCookies('value00',$('#goodsNumberInput').val(),10)*/
			})
			
			
			addBtn.click(function(){
			value++;
			
			oNum.val(value);
			
			$(".c_sum p i").html(value*2098);
			lessBtn.removeClass("disabled");
			$(".c_piece i").html(value);
			$(".fs_15").html(value*2098);
			$(".c_paid i").html(value*2098-10);
			setCookies('valu',$(".valu").val(),10);
			/*setCookies('title00',pro_Name.html(),10)
				
			setCookies('price0',pro_Price.html(),10)
			setCookies('value00',$('#goodsNumberInput').val(),10)*/
			})
			
			
		
			
	})	
})(jQuery)
